#include <iostream>
#include <stdio.h>
#include <algorithm>
using namespace std;
typedef long long ll;
const ll MAXN=1e6+7;
ll pokers[MAXN];
ll value[MAXN];
int main() {
	ll n,tmp;
	while (cin>>n) {
		for (int i=0; i<n; ++i) {
			scanf("%lld", &pokers[i]);
		}
//		for (int i=0; i<2*n; ++i) cout<<pokers[i]<<" ";
//		cout<<endl;
		for (int i=0; i<n; ++i) {
			scanf("%lld", &tmp);
			value[i]=pokers[i]-tmp;
		}
//		for (int i=0; i<2*n; ++i) cout<<value[i]<<" ";
//		cout<<endl;
		ll res; ll max=0;
		ll cnt_v=0, cnt_g=0;
		ll st=0,en=0;
		while (st<n && en<2*n) {
			while (cnt_v>=0 && en-st<n) {
				cnt_v+=value[en%n];
				cnt_g+=pokers[en%n];
				++en;
			}
			if (cnt_g>max) {
				max=cnt_g;
				res=st;
			}
			if (en-st==n) break;
			cnt_v-=value[st];
			cnt_g-=pokers[st];
			++st;
		}
		cout<<res<<endl;
	}
	return 0;
}
